home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_55726.txt < prev    next >
Text File  |  1991-02-27  |  2KB  |  35 lines

  1. -- card: 55726 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. C++ has many features not available in TC, while TC has a few features not available in C++.  Appendix 2 details these differences.  With careful coding and the use of conditional compilation, TC programs can be made to compile equally under C++.
  11.  
  12. C++ does not support TC's feature to automatically prevent header file reinclusion.  Thus to portably avoid reinclusion TC header files should use explicit conditional compilation*.
  13.  
  14. In TC all member functions are considered 'virtual', so this keyword is not required as it is in C++.  To obtain compatibility, the original declarations of all member functions  (as opposed to any overriding declarations in descendant classes) should be preceded with the 'virtual' keyword.  If TC is being used a macro may be used to replace 'virtual' with nothing.  The following may be placed in the header for the root class (such as Generic_Class in the sample program in Chapter 4), so that the definition will be            #included into all descendant classes:
  15.  
  16.  
  17. -- part contents for background part 6
  18. ----- text -----
  19. 7.4  TC/C++ Portability
  20.  
  21. -- part contents for background part 7
  22. ----- text -----
  23. 183
  24.  
  25. -- part contents for background part 29
  26. ----- text -----
  27. 56532
  28.  
  29. -- part contents for background part 27
  30. ----- text -----
  31. Preventing file reinclusion
  32.  
  33. -- part contents for background part 20
  34. ----- text -----
  35. Preventing file reinclusion - p182